Skip to content

Persist QColorDialog custom color selections in ModOrganizer.ini#2396

Open
JonathanFeenstra wants to merge 3 commits into
ModOrganizer2:masterfrom
JonathanFeenstra:store-custom-colors
Open

Persist QColorDialog custom color selections in ModOrganizer.ini#2396
JonathanFeenstra wants to merge 3 commits into
ModOrganizer2:masterfrom
JonathanFeenstra:store-custom-colors

Conversation

@JonathanFeenstra
Copy link
Copy Markdown
Member

Custom colors selected in QColorDialog used to be saved globally in Mod Organizer v2.5.2, but in Qt 6.11.0, this is no longer the case. As a result, they now reset every time after restarting the program.

This PR fixes that by storing them in ModOrganizer.ini.

@Silarn Silarn self-requested a review May 14, 2026 06:36
Silarn
Silarn previously approved these changes May 14, 2026
Copy link
Copy Markdown
Member

@Silarn Silarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this is working.

@Silarn Silarn requested a review from Holt59 May 14, 2026 06:38
@Holt59
Copy link
Copy Markdown
Member

Holt59 commented May 14, 2026

Does this mean that people upgrading to latest MO2 will lose their color settings? If yes, is there a way to migrate?

@JonathanFeenstra
Copy link
Copy Markdown
Member Author

They seem to be stored in the Windows registry under HKEY_CURRENT_USER\Software\QtProject\OrganizationDefaults\Qt\customColors. Should we add an option in the installer to migrate them to ModOrganizer.ini?

@Silarn
Copy link
Copy Markdown
Member

Silarn commented May 15, 2026

Might be better to use MO2's upgrade functions to look for and import those settings if they are not defined in the local config.

@Silarn
Copy link
Copy Markdown
Member

Silarn commented May 22, 2026

@JonathanFeenstra I would like to merge this but I think we should try importing the previous color settings. There should be an upgrade function when we detect a new MO2 version. I don't think it has to be handled by the installer.

I also don't think we should delete those registry entries since each MO2 instance would have to save the color settings now.

@JonathanFeenstra
Copy link
Copy Markdown
Member Author

There's MainWindow::processUpdates that calls this:

settings.processUpdates(currentVersion, lastVersion);

I'm assuming the next release version number will be 2.6.0. I tested that the copyGlobalCustomColors I added works correctly by overwriting currentVersion to 2.6.0 using the debugger on this line:

if (currentVersion == lastVersion) {

@Silarn
Copy link
Copy Markdown
Member

Silarn commented May 23, 2026

I suppose we'll use 2.6. Testers can always drop their version number back to 2.5.2 in the mo.ini to test the upgrade process. Each instance tracks that separately.

@Silarn Silarn self-requested a review May 23, 2026 15:26
@Silarn
Copy link
Copy Markdown
Member

Silarn commented May 23, 2026

I think this looks fine. I'll include it in the beta but I suppose we'll need to test in the 2.6.0 RC.

Holt59
Holt59 previously approved these changes May 25, 2026
@Silarn
Copy link
Copy Markdown
Member

Silarn commented May 25, 2026

Should have noticed sooner and it would probably only be an issue for people running the betas, but we may want to only transfer the color settings if values haven't already been set (or are the default values).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants